#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;

class Base
{
public:
	virtual void func1()
	{
		cout << "Base::func1()";
	}
	virtual void func2()
	{
		cout << "Base::func2()";
	}
};

class Derived :public Base
{
public:
	virtual void func1()
	{
		cout << "Derived::func1()";
	}

};
//class A :public Derived
//{
//public:
//	virtual void func()
//	{
//		cout << "hello" << endl;
//	}
//	virtual void func4()
//	{
//		cout << "A::func4()";
//	}
//private:
//	int _a;
//};
void Func(Base& b)
{
	b.func1();
	cout << endl;
}
int main()
{
	Base b;
	Derived d;
	Func(b);
	Func(d);
	return 0;
}